﻿
//String, extends the default String object.
LightScript.using("LightScript.Core", function()
{
    var thisClass = LightScript.Core.createClass("LightScript.String");

    //# Private Members
    
    //# Constructions
    
    //# Public Members
    thisClass.startsWith = function(str, pattern)
    {
        return str.indexOf(pattern) === 0;
    }

    thisClass.endsWith = function(str, pattern)
    {
        var d = str.length - pattern.length;
        return d >= 0 && str.lastIndexOf(str, pattern) === d;
    }

    thisClass.trim = function(str, pattern)
    {
        return str.replace(/^\s*|\s*$/g,"");
    }
    
    //# Private Methods
    
    //# Public Methods

    //# Shortcuts
});
